Completed
Push — master ( 158ed8...34f194 )
by Alejandro
04:53 queued 02:19
created

MuttedMessage.js ➔ MutedMessage   A

Complexity

Conditions 1

Size

Total Lines 14
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 14
ccs 2
cts 2
cp 1
rs 9.75
c 0
b 0
f 0
cc 1
crap 1
1
import React from 'react';
2
import { Card } from 'reactstrap';
3
import classnames from 'classnames';
4
import PropTypes from 'prop-types';
5
6 2
const DEFAULT_MARGIN_SIZE = 4;
7 2
const propTypes = {
8
  marginSize: PropTypes.number,
9
  children: PropTypes.node,
10
};
11
12
export default function MutedMessage({ children, marginSize = DEFAULT_MARGIN_SIZE }) {
13 5
  const cardClasses = classnames('bg-light', {
14
    [`mt-${marginSize}`]: marginSize > 0,
15
  });
16
17 5
  return (
18
    <div className="col-md-10 offset-md-1">
19
      <Card className={cardClasses} body>
20
        <h3 className="text-center text-muted mb-0">
21
          {children}
22
        </h3>
23
      </Card>
24
    </div>
25
  );
26
}
27
28
MutedMessage.propTypes = propTypes;
29